name: Publish Wheel to PyPI

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Version of the wheel to publish (format X.Y.Z - no "v"!).'
        required: true

jobs:
  publish-wheel:
    runs-on: ubuntu-latest
    steps:
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Download artifact
        uses: actions/download-artifact@v4
        with:
          name: nemoguardrails-${{ github.event.inputs.version }}.whl

      - name: Publish package
        uses: pypa/gh-action-pypi-publish@release/v1
        with:
          verbose: true
          password: ${{ secrets.PYPI_API_TOKEN }}
          packages-dir: ./
